﻿
#include "widget.h"
#include "slidingSideWindow.h"
#include <QDebug>
widget::widget(QWidget *parent)
    : QWidget{parent}
{
    this->resize(800,600);
    this->setWindowFlag(Qt::WindowStaysOnTopHint);
    //线性渐变
    setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, "
                  "stop:0 #e60042, stop:0.05 #d40f52, stop:0.20 #c21d62, stop:0.31 #af2c72, "
                  "stop:0.45 #7958a3, stop:0.79 #8b4993, stop:0.86 #6667b3, stop:0.935 #5475c3);");
    auto pSideWindow=new SlidingSideWindow(this);
    pSideWindow->move(this->rect().center().x()-pSideWindow->width()/2,
                      this->rect().center().y()-pSideWindow->height()/2);
    qDebug()<<__FUNCTION__<<" :x ="<<this->rect().center().x()-pSideWindow->width()/2;
    qDebug()<<__FUNCTION__<<" :y ="<<this->rect().center().y()-pSideWindow->height()/2;
}

widget::~widget()
{

}

